home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / MOV_PTR.ASM < prev    next >
Assembly Source File  |  1987-06-25  |  1KB  |  46 lines

  1. ;    DESC:    Moves the file read/write pointer                    V1.00
  2. ;    IN:    *{METH_VAL} Method value
  3. ;         (0:ofst,1:ofst+cloc,2:eof+offset)
  4. ;        *{HANDLE} handle
  5. ;        *{MSW} most significant word of offset
  6. ;        *{LSW} least significant word of offset
  7. ;    OUT:    *{OMSW} most significant word of pointer location
  8. ;        *{OLSW} least significant word of pointer location
  9. ;    SAMPLE:    Callm    MOV_PTR,<METH_VAL,HANDLE,MSW,LSW>,<OMSW,OLSW>
  10. ;    ################################################################## 
  11.  
  12.     Extrn    PUSHALL:Near
  13.     Extrn    POPALL:Near
  14.     Extrn    ERRORMSG:Near            ;report error messages.
  15.  
  16. MOV_PTRC    Segment
  17.     Assume    CS:MOV_PTRC
  18.     Public    MOV_PTR
  19.  
  20.                         ;notice.
  21.     DB    'MOV_PTR  - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  22.  
  23. MOV_PTR    Proc    Near                ;moves file read/write ptrs.
  24.     Call    PUSHALL
  25.  
  26.     Pop    DX                ;get lsw of offset.
  27.     Pop    CX                ;get msw of offset.
  28.     Pop    BX                ;get handle.
  29.     Pop    AX                ;get method value.
  30.  
  31.     Mov    AH,42H                ;moves file read/write ptr.
  32.     Int    21H
  33.     Jc    ERROR                ;if an error report it.
  34.  
  35.     Push    AX                ;return lsw offset.
  36.     Push    DX                ;return msw offset.
  37.     Call    POPALL
  38.     Ret
  39.  
  40. ERROR:    Push    AX                ;report error and abort.
  41.     Call    ERRORMSG
  42.  
  43. MOV_PTR    Endp
  44. MOV_PTRC    Ends
  45.     End
  46.